﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace InputKeyboard.Converter
{
    /// <summary>
    /// 文本大小写转换显示
    /// </summary>
    public class CapitalCharConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool b && parameter is string s) return b ? s.ToUpper() : s.ToLower();
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }
    }
}
